//
//  SingerFormTableViewCell.m
//  FormTableViewDemo
//
//  Created by zkingsoft on 16/1/5.
//  Copyright (c) 2016年 zkingsoft. All rights reserved.
//

#import "SingerFormTableViewCell.h"

static SingerFormView *_singerView;


@interface SingerFormTableViewCell ()<SingerFormViewDelegate>

@end

@implementation SingerFormTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{// 当cell 刷出来一个就会调用这个
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        NSLog(@"=======");
        for (int i = 0; i < KCOUNT; i++) {
            _singerView = [[SingerFormView alloc] initWithFrame:CGRectMake(i*WIDTH+1, 1, WIDTH-2, HEIGHT-2)];
            _singerView.delegate = self;
            _singerView.listRow = i;            
            
            _singerView.formContentText = [NSString stringWithFormat:@"表格00%d", i];
            [self.contentView addSubview:_singerView];
        }
    }
    return self;
}

- (void)FormViewIsClicked:(SingerFormView *)formView{
    if ([_delegate respondsToSelector:@selector(FormTableViewCellIsClicked:withFormView:)]) {
        [_delegate  FormTableViewCellIsClicked:self withFormView:formView];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
